package com.lry.basic.thread.demo;

public class Main {

    public static void main(String[] args) {
        Storage storage = new Storage();
        Thread p1 = new Thread(new Producer(storage),"一");
        Thread p2 = new Thread(new Producer(storage),"二");
        Thread p3 = new Thread(new Producer(storage),"三");

        Thread c1 = new Thread(new Consumer(storage),"一");
        Thread c2 = new Thread(new Consumer(storage),"二");
        Thread c3 = new Thread(new Consumer(storage),"三");
        Thread c4 = new Thread(new Consumer(storage),"四");

        p1.start();
        p2.start();
        p3.start();

        c1.start();
        c2.start();
        c3.start();
        c4.start();
    }
}
